package luj.tool.jnproxyan.proxy.admin.http.handle.invoke;

import luj.tool.jnproxyan.proxy.admin.AdminHttpHandler;

final class ParamImpl implements AdminHttpHandler.Param {

  @Override
  public String name() {
    return _name;
  }

  @Override
  public boolean exists() {
    return _value != null;
  }

  @Override
  public String asStr() {
    return _value.toString();
  }

  @Override
  public int asInt() {
    return Integer.parseInt(asStr());
  }

  @Override
  public long asLong() {
    return Long.parseLong(asStr());
  }

  @Override
  public double asDouble() {
    return Double.parseDouble(asStr());
  }

  String _name;

  Object _value;
}
